-
Notifications
You must be signed in to change notification settings - Fork 117
feat(l2): commit blocks instead of state diffs #5135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Lines of code reportTotal lines added: Detailed view |
Benchmark Results ComparisonNo significant difference was registered for any benchmark run. Detailed ResultsBenchmark Results: BubbleSort
Benchmark Results: ERC20Approval
Benchmark Results: ERC20Mint
Benchmark Results: ERC20Transfer
Benchmark Results: Factorial
Benchmark Results: FactorialRecursive
Benchmark Results: Fibonacci
Benchmark Results: FibonacciRecursive
Benchmark Results: ManyHashes
Benchmark Results: MstoreBench
Benchmark Results: Push
Benchmark Results: SstoreBench_no_opt
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR deprecates the state diff-based data availability mechanism in favor of publishing full transaction lists in blobs. This significantly simplifies the codebase by removing complex state diff calculation and encoding logic.
Key Changes:
- Removed state diff calculation and encoding infrastructure from L2 hooks, payload builder, and prover
- Modified blob generation to encode transaction lists and fee configs instead of state diffs
- Updated L1 fee calculation to use transaction size instead of account diff size
- Added deprecation warning in state diff documentation
Reviewed Changes
Copilot reviewed 27 out of 33 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| docs/l2/fundamentals/state_diff.md | Added deprecation warning for state diff-based data availability |
| docs/l2/fundamentals/data_availability.md | Added placeholder for new data availability documentation |
| docs/l2/block_vs_state_diff_measurements.md | Added comprehensive measurement documentation comparing state diffs vs transaction lists |
| crates/vm/levm/src/utils.rs | Removed get_account_diffs_in_tx function and related imports |
| crates/vm/levm/src/hooks/l2_hook.rs | Removed state diff calculation, switched to transaction size for L1 fee calculation |
| crates/vm/levm/src/hooks/hook.rs | Simplified L2 hook initialization |
| crates/vm/backends/levm/mod.rs | Added get_max_allowed_gas_limit function and improved GenericTransaction conversion |
| crates/networking/rpc/eth/transaction.rs | Updated estimate gas to use new gas limit cap |
| crates/l2/utils/state_reconstruct.rs | New file with state reconstruction utilities |
| crates/l2/utils/mod.rs | Added state_reconstruct module |
| crates/l2/utils/error.rs | Added new error variants for state reconstruction |
| crates/l2/tests/tests.rs | Updated tests to calculate transaction sizes instead of account diff sizes |
| crates/l2/storage/src/store_db/sql.rs | Renamed parameter from state_diff to blobs |
| crates/l2/sequencer/l1_committer.rs | Major refactor to generate blobs from transaction lists instead of state diffs |
| crates/l2/sequencer/errors.rs | Removed StateDiffError references |
| crates/l2/sequencer/block_producer/payload_builder.rs | Simplified transaction selection using encoded size instead of state diff size |
| crates/l2/prover/src/guest_program/src/execution.rs | Updated blob verification to use transaction lists |
| crates/l2/contracts/src/l1/OnChainProposer.sol | Renamed stateDiffKZGVersionedHash to BlobKZGVersionedHash |
| crates/l2/common/src/state_diff.rs | Entire file deleted |
| crates/l2/common/src/lib.rs | Removed state_diff module |
| crates/l2/based/block_fetcher.rs | Refactored to use shared state reconstruction utility |
| crates/l2/Makefile | Removed reconstruct command parameter |
| crates/common/types/l2.rs | Removed account_diff module |
| fixtures/blobs/6-1.blob | New blob fixture file |
Comments suppressed due to low confidence (1)
docs/l2/fundamentals/state_diff.md:4
- Corrected spacing: there should be no space between 'state' and 'diffs' when enclosed in backticks.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Motivation
First step toward our shared bridge implementation, ensuring transaction availability through blobs and simplifying our
L1 feemechanism.Description
Currently, data availability is achieved by publishing
State diffsthrough blobs.In this PR, we change that approach by directly publishing all the blocks of a batch (RLP-encoded) within the blobs, along with their corresponding
Fee configs.#5235 was created to improve our estimate gas mechanism.
Closes None